<?php
class SettingsController extends AppController {

	var $name = 'Settings';
	var $uses = array('Setting');

	function admin_site() {
		if(!empty($this->data)) {
			if($this->Setting->save($this->data)) {
				$this->Session->setFlash(__('SETTINGS_SAVE_OK',true));
				$this->redirect('site',null,true);
			} else {
				$this->Session->setFlash(__('SETTINGS_SAVE_ERROR',true));
			}
		} else {
			$this->data = $this->Setting->findById(1);
		}
	}

}
?>